test(formula): correct the stale #6133 comment in parse-cel-to-ast.test.ts (#6678) - #7203
Merged
Merged
Conversation
…st.ts (#6678) Two comments in `parse-cel-to-ast.test.ts` described `classifyError`'s pre-#6202 behaviour as if it were current: - `:139-143` told the next reader that `((record.a)` is graded `runtime` because cel-js's `Expected RPAREN, got EOF` misses `classifyError`'s /parse|unexpected|syntax/i, and instructed them that asserting the correct verdict "would enshrine it". - `:116-118` gave "`classifyError` reads the phrasing" as the live reason for a test-design decision. Neither holds. PR #6202 (#6133) made the ParseError arm structural and PR #6677 (#6223) deleted the keyword table; the regex quoted in the first comment had no remaining occurrence in the package except that comment. Measured on this branch rather than taken from the changelog: "((record.a)" -> kind=parse | Expected RPAREN, got EOF "record.budget >" -> kind=parse | Unexpected token: EOF "record.a $$ 1" -> kind=parse | Unexpected character: $ "record.a ?? 3" -> kind=parse | Unexpected token: QUESTION The message wording is unchanged; only the grading moved. The comments are rewritten to that measurement, and `((record.a)` is promoted from "deliberately not asserted" to an ordinary assertion alongside `record.budget >`, since the verdict it was withheld over is now stable. No assertion in the file encoded the old grading, so nothing behavioural was pinned wrong; the omission was the only stale artefact besides prose.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckNo hand-written docs reference the 0 changed package(s). ✅ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6678.
packages/formula/src/parse-cel-to-ast.test.tscarried two comments describingclassifyError's pre-#6202 behaviour as if it were current. The first does not merely go stale, it instructs: it tells the next author that asserting((record.a) -> parse"would enshrine it", i.e. that today's correct verdict is a bug not to be pinned.What I measured, before rewriting anything
Per the card, the current grading was established by running the case, not by paraphrasing PR #6202. Temporary probe on this branch calling
celEngine.compileover the wholeSYNTAX_REJECTEDlist (probe removed before the commit):Two things fall out of that, and only one of them was in the card:
((record.a)gradesparse, notruntime.Expected RPAREN, got EOF. What changed is that the phrasing no longer decides anything:classifyCelFaultnow branches onerr instanceof ParseError(celEngine 的 classifyError 把「括号/方括号不配对」这类真语法错答成 kind: 'runtime',而该 kind 会原样出现在作者可见的拒写消息与 REST 响应体里 #6133 / PR fix(formula): classifyError 把 cel-js 的 parse 错误按错误类归为 syntax/parse,不再误报 runtime (#6133) #6202), and the keyword table was deleted outright by classifyError 的 type/runtime 两支仍按文案分类,而 cel-js 把作者源码嵌进 message —— 字段名叫 parse_status 的记录,求值期故障被答成 kind: 'parse' #6223 / PR fix(formula): grade CEL faults by error class + code, not by the message (#6223) #6677. The rewritten comment keeps the measured wording and corrects the mechanism, rather than deleting both.Confirming the regex the comment quotes is gone: the only occurrence of
parse|unexpected|syntaxanywhere underpackages/formula/src/was the stale comment itself.Were the surrounding assertions stale too?
No — checked, and this is the one part of the card that resolves in the reassuring direction. Nothing in the file asserts
runtimefor any source; the onlyruntimeon line 142 was inside the prose. The old grading was never pinned, it was omitted — the test assertedrecord.budget >and deliberately said nothing about((record.a). So there is no second half to file: the fix is text plus closing the omission the text was rationalising.Changes
:115-121— the parity note now says classification is independent of wording and cites the two PRs that made it so.:135-144— the "NOT asserted / would enshrine it" note is replaced by anit.eachthat asserts both wordings gradeparse, promoting((record.a)to an ordinary assertion now that its verdict is stable. The comment records both measured messages and points atcel-error-classification.test.tsas the exhaustive per-wording matrix, so the two suites do not read as rival sources of truth.Changeset
None added; this PR needs the
skip-changesetlabel. Read from the gates rather than assumed:changeset-checkinpr-automation.ymlhas no path-based exemption — it counts.changeset/*.mdadded against the merge base whatever the diff touches. Its only two exemptions are theskip-changesetlabel and thechangeset-release/mainPR.check:empty-changeset(空 frontmatter changeset 相对skip-changeset标签零收益、单向风险 —— 「禁止空 changeset 进 .changeset/」的决策证据(#5292 结案后无处存放) #5471) rejects an empty changeset a PR newly introduces, andlint.ymlis explicit that the label and an empty file are not equals downstream — the label produces no input forchangesets/action, an empty changeset produces a real one.lint.yml:372-375calls the textbookskip-changesetcase.Worth noting for the lane: taking that label means
changeset-checkis skipped wholesale, so the changeset-family self-tests do not run from there. They are covered anyway —lint.yml'sChangeset-family gate self-testsstep is deliberately unconditional (#6509).Verification
Related: #6678, #6133 / PR #6202, #6223 / PR #6677, #4812.
Generated by Claude Code